using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._NetworkDiagramTools._Configuration
{
    /// <summary>
    /// <para>Add Spatial Query Rule</para>
    /// <para>Adds a diagram rule that automatically appends new network features to the diagrams based on their location relative to the network features currently represented in the diagram.</para>
    /// <para>添加逻辑示意图规则，该规则根据新网络要素相对于逻辑示意图中当前表示的网络要素的位置自动将新网络要素追加到逻辑示意图中。</para>
    /// </summary>    
    [DisplayName("Add Spatial Query Rule")]
    public class AddSpatialQueryRule : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddSpatialQueryRule()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_utility_network">
        /// <para>Input Network</para>
        /// <para>The utility network or trace network containing the diagram template to modify.</para>
        /// <para>包含要修改的逻辑示意图模板的公共设施网络或追踪网络。</para>
        /// </param>
        /// <param name="_template_name">
        /// <para>Input Diagram Template</para>
        /// <para>The name of the diagram template to modify.</para>
        /// <para>要修改的逻辑示意图模板的名称。</para>
        /// </param>
        /// <param name="_is_active">
        /// <para>Active</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the rule will be active when generating and updating diagrams based on the specified template.
        ///   <bulletList>
        ///     <bullet_item>Checked—The added rule will become active during the generation and update of any diagrams based on the input template. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The added rule will not become active during the generation or update of any diagrams based on the input template.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定在基于指定模板生成和更新关系图时，规则是否处于活动状态。
        ///   <bulletList>
        ///     <bullet_item>选中 - 在基于输入模板生成和更新任何逻辑示意图期间，添加的规则将变为活动状态。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 在基于输入模板生成或更新任何逻辑示意图期间，添加的规则将不会变为活动状态。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_added_features">
        /// <para>Add Features</para>
        /// <para>The source feature class to which features will be added.</para>
        /// <para>将向其添加要素的源要素类。</para>
        /// </param>
        /// <param name="_overlap_type">
        /// <para>Relationship</para>
        /// <para><xdoc>
        ///   <para>Specifies the spatial relationship between the features.</para>
        ///   <bulletList>
        ///     <bullet_item>Intersect— The features in the Add Features source feature class will be appended to the diagram if they intersect one of the Existing Features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Within a distance— The features in the Add Features source feature class will be appended to the diagram if they are within the specified distance (using Euclidean distance) of one of the Existing Features. Use the Search Distance parameter to specify the distance.</bullet_item><para/>
        ///     <bullet_item>Contains | Is contained of— The features in the Add Features source feature class will be appended to the diagram if they contain features from or are contained in the Existing Features.</bullet_item><para/>
        ///     <bullet_item>Within— The features in the Add Features source feature class will be appended to the diagram if they are within Existing Features.</bullet_item><para/>
        ///     <bullet_item>Boundary touches— The features in the Add Features source feature class will be appended to the diagram if they have a boundary that touches one of the Existing Features. When the Existing Features are lines or polygons, the boundary of the Add Features input feature can only touch the boundary of one of the Existing Features, and no part of the input feature can cross the boundary of one of the Existing Features.</bullet_item><para/>
        ///     <bullet_item>Share a line segment with— The features in the Add Features source feature class will be appended to the diagram if they share a line segment with one of the Existing Features. The added and existing features must be line or polygon.</bullet_item><para/>
        ///     <bullet_item>Crossed by the outline of— The features in the Add Features source feature class will be appended to the diagram if they are crossed by the outline of one of the Existing Features. The added and existing features must be lines or polygons. If polygons are used for the Existing Features, the polygon's boundary (line) will be used. Lines that cross at a point will be appended; lines that share a line segment will not.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要素之间的空间关系。</para>
        ///   <bulletList>
        ///     <bullet_item>相交—如果添加要素源要素类中的要素与其中一个现有要素相交，则这些要素将追加到逻辑示意图中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>在距离内 - 如果添加要素源要素类中的要素位于其中一个现有要素的指定距离（使用欧几里得距离）内，则这些要素将追加到逻辑示意图中。使用搜索距离参数指定距离。</bullet_item><para/>
        ///     <bullet_item>包含 |包含 - 如果添加要素源要素类中的要素包含来自现有要素或包含在现有要素中的要素，则这些要素将追加到逻辑示意图中。</bullet_item><para/>
        ///     <bullet_item>内 - 如果添加要素源要素类中的要素位于现有要素中，则这些要素将追加到逻辑示意图中。</bullet_item><para/>
        ///     <bullet_item>边界接触 - 如果添加要素源要素类中的要素具有与现有要素之一接触的边界，则这些要素将追加到逻辑示意图中。当现有要素为直线或面时，添加要素输入要素的边界只能触及其中一个现有要素的边界，并且输入要素的任何部分都不能越过其中一个现有要素的边界。</bullet_item><para/>
        ///     <bullet_item>共享线段 - 如果添加要素源要素类中的要素与其中一个现有要素共享线段，则这些要素将追加到逻辑示意图中。添加的要素和现有要素必须为线或面。</bullet_item><para/>
        ///     <bullet_item>被轮廓交叉 - 如果添加要素源要素类中的要素被其中一个现有要素的轮廓交叉，则这些要素将被追加到逻辑示意图中。添加的要素和现有要素必须为直线或面。如果面用于现有要素，则将使用面的边界（线）。将附加在某个点交叉的线;共享线段的线不会。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_existing_features">
        /// <para>Existing Features</para>
        /// <para>The source feature class on which the spatial query will execute.</para>
        /// <para>将对其执行空间查询的源要素类。</para>
        /// </param>
        public AddSpatialQueryRule(object _in_utility_network, object _template_name, _is_active_value _is_active, object _added_features, _overlap_type_value _overlap_type, object _existing_features)
        {
            this._in_utility_network = _in_utility_network;
            this._template_name = _template_name;
            this._is_active = _is_active;
            this._added_features = _added_features;
            this._overlap_type = _overlap_type;
            this._existing_features = _existing_features;
        }
        public override string ToolboxName => "Network Diagram Tools";

        public override string ToolName => "Add Spatial Query Rule";

        public override string CallName => "nd.AddSpatialQueryRule";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_utility_network, _template_name, _is_active.GetGPValue(), _added_features, _overlap_type.GetGPValue(), _existing_features, _search_distance, _added_where_clause, _existing_where_clause, _description, _out_utility_network, _out_template_name];

        /// <summary>
        /// <para>Input Network</para>
        /// <para>The utility network or trace network containing the diagram template to modify.</para>
        /// <para>包含要修改的逻辑示意图模板的公共设施网络或追踪网络。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_utility_network { get; set; }


        /// <summary>
        /// <para>Input Diagram Template</para>
        /// <para>The name of the diagram template to modify.</para>
        /// <para>要修改的逻辑示意图模板的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Diagram Template")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _template_name { get; set; }


        /// <summary>
        /// <para>Active</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the rule will be active when generating and updating diagrams based on the specified template.
        ///   <bulletList>
        ///     <bullet_item>Checked—The added rule will become active during the generation and update of any diagrams based on the input template. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The added rule will not become active during the generation or update of any diagrams based on the input template.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定在基于指定模板生成和更新关系图时，规则是否处于活动状态。
        ///   <bulletList>
        ///     <bullet_item>选中 - 在基于输入模板生成和更新任何逻辑示意图期间，添加的规则将变为活动状态。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 在基于输入模板生成或更新任何逻辑示意图期间，添加的规则将不会变为活动状态。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Active")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _is_active_value _is_active { get; set; }

        public enum _is_active_value
        {
            /// <summary>
            /// <para>ACTIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ACTIVE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>INACTIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INACTIVE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Add Features</para>
        /// <para>The source feature class to which features will be added.</para>
        /// <para>将向其添加要素的源要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Add Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _added_features { get; set; }


        /// <summary>
        /// <para>Relationship</para>
        /// <para><xdoc>
        ///   <para>Specifies the spatial relationship between the features.</para>
        ///   <bulletList>
        ///     <bullet_item>Intersect— The features in the Add Features source feature class will be appended to the diagram if they intersect one of the Existing Features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Within a distance— The features in the Add Features source feature class will be appended to the diagram if they are within the specified distance (using Euclidean distance) of one of the Existing Features. Use the Search Distance parameter to specify the distance.</bullet_item><para/>
        ///     <bullet_item>Contains | Is contained of— The features in the Add Features source feature class will be appended to the diagram if they contain features from or are contained in the Existing Features.</bullet_item><para/>
        ///     <bullet_item>Within— The features in the Add Features source feature class will be appended to the diagram if they are within Existing Features.</bullet_item><para/>
        ///     <bullet_item>Boundary touches— The features in the Add Features source feature class will be appended to the diagram if they have a boundary that touches one of the Existing Features. When the Existing Features are lines or polygons, the boundary of the Add Features input feature can only touch the boundary of one of the Existing Features, and no part of the input feature can cross the boundary of one of the Existing Features.</bullet_item><para/>
        ///     <bullet_item>Share a line segment with— The features in the Add Features source feature class will be appended to the diagram if they share a line segment with one of the Existing Features. The added and existing features must be line or polygon.</bullet_item><para/>
        ///     <bullet_item>Crossed by the outline of— The features in the Add Features source feature class will be appended to the diagram if they are crossed by the outline of one of the Existing Features. The added and existing features must be lines or polygons. If polygons are used for the Existing Features, the polygon's boundary (line) will be used. Lines that cross at a point will be appended; lines that share a line segment will not.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要素之间的空间关系。</para>
        ///   <bulletList>
        ///     <bullet_item>相交—如果添加要素源要素类中的要素与其中一个现有要素相交，则这些要素将追加到逻辑示意图中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>在距离内 - 如果添加要素源要素类中的要素位于其中一个现有要素的指定距离（使用欧几里得距离）内，则这些要素将追加到逻辑示意图中。使用搜索距离参数指定距离。</bullet_item><para/>
        ///     <bullet_item>包含 |包含 - 如果添加要素源要素类中的要素包含来自现有要素或包含在现有要素中的要素，则这些要素将追加到逻辑示意图中。</bullet_item><para/>
        ///     <bullet_item>内 - 如果添加要素源要素类中的要素位于现有要素中，则这些要素将追加到逻辑示意图中。</bullet_item><para/>
        ///     <bullet_item>边界接触 - 如果添加要素源要素类中的要素具有与现有要素之一接触的边界，则这些要素将追加到逻辑示意图中。当现有要素为直线或面时，添加要素输入要素的边界只能触及其中一个现有要素的边界，并且输入要素的任何部分都不能越过其中一个现有要素的边界。</bullet_item><para/>
        ///     <bullet_item>共享线段 - 如果添加要素源要素类中的要素与其中一个现有要素共享线段，则这些要素将追加到逻辑示意图中。添加的要素和现有要素必须为线或面。</bullet_item><para/>
        ///     <bullet_item>被轮廓交叉 - 如果添加要素源要素类中的要素被其中一个现有要素的轮廓交叉，则这些要素将被追加到逻辑示意图中。添加的要素和现有要素必须为直线或面。如果面用于现有要素，则将使用面的边界（线）。将附加在某个点交叉的线;共享线段的线不会。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Relationship")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _overlap_type_value _overlap_type { get; set; }

        public enum _overlap_type_value
        {
            /// <summary>
            /// <para>Intersect</para>
            /// <para>Intersect— The features in the Add Features source feature class will be appended to the diagram if they intersect one of the Existing Features. This is the default.</para>
            /// <para>相交—如果添加要素源要素类中的要素与其中一个现有要素相交，则这些要素将追加到逻辑示意图中。这是默认设置。</para>
            /// </summary>
            [Description("Intersect")]
            [GPEnumValue("INTERSECT")]
            _INTERSECT,

            /// <summary>
            /// <para>Within a distance</para>
            /// <para>Within a distance— The features in the Add Features source feature class will be appended to the diagram if they are within the specified distance (using Euclidean distance) of one of the Existing Features. Use the Search Distance parameter to specify the distance.</para>
            /// <para>在距离内 - 如果添加要素源要素类中的要素位于其中一个现有要素的指定距离（使用欧几里得距离）内，则这些要素将追加到逻辑示意图中。使用搜索距离参数指定距离。</para>
            /// </summary>
            [Description("Within a distance")]
            [GPEnumValue("WITHIN_A_DISTANCE")]
            _WITHIN_A_DISTANCE,

            /// <summary>
            /// <para>Contains | Is contained of</para>
            /// <para>Contains | Is contained of— The features in the Add Features source feature class will be appended to the diagram if they contain features from or are contained in the Existing Features.</para>
            /// <para>包含 |包含 - 如果添加要素源要素类中的要素包含来自现有要素或包含在现有要素中的要素，则这些要素将追加到逻辑示意图中。</para>
            /// </summary>
            [Description("Contains | Is contained of")]
            [GPEnumValue("CONTAINS")]
            _CONTAINS,

            /// <summary>
            /// <para>Within</para>
            /// <para>Within a distance— The features in the Add Features source feature class will be appended to the diagram if they are within the specified distance (using Euclidean distance) of one of the Existing Features. Use the Search Distance parameter to specify the distance.</para>
            /// <para>在距离内 - 如果添加要素源要素类中的要素位于其中一个现有要素的指定距离（使用欧几里得距离）内，则这些要素将追加到逻辑示意图中。使用搜索距离参数指定距离。</para>
            /// </summary>
            [Description("Within")]
            [GPEnumValue("WITHIN")]
            _WITHIN,

            /// <summary>
            /// <para>Boundary touches</para>
            /// <para>Boundary touches— The features in the Add Features source feature class will be appended to the diagram if they have a boundary that touches one of the Existing Features. When the Existing Features are lines or polygons, the boundary of the Add Features input feature can only touch the boundary of one of the Existing Features, and no part of the input feature can cross the boundary of one of the Existing Features.</para>
            /// <para>边界接触 - 如果添加要素源要素类中的要素具有与现有要素之一接触的边界，则这些要素将追加到逻辑示意图中。当现有要素为直线或面时，添加要素输入要素的边界只能触及其中一个现有要素的边界，并且输入要素的任何部分都不能越过其中一个现有要素的边界。</para>
            /// </summary>
            [Description("Boundary touches")]
            [GPEnumValue("BOUNDARY_TOUCHES")]
            _BOUNDARY_TOUCHES,

            /// <summary>
            /// <para>Share a line segment with</para>
            /// <para>Share a line segment with— The features in the Add Features source feature class will be appended to the diagram if they share a line segment with one of the Existing Features. The added and existing features must be line or polygon.</para>
            /// <para>共享线段 - 如果添加要素源要素类中的要素与其中一个现有要素共享线段，则这些要素将追加到逻辑示意图中。添加的要素和现有要素必须为线或面。</para>
            /// </summary>
            [Description("Share a line segment with")]
            [GPEnumValue("SHARE_A_LINE_SEGMENT_WITH")]
            _SHARE_A_LINE_SEGMENT_WITH,

            /// <summary>
            /// <para>Crossed by the outline of</para>
            /// <para>Crossed by the outline of— The features in the Add Features source feature class will be appended to the diagram if they are crossed by the outline of one of the Existing Features. The added and existing features must be lines or polygons. If polygons are used for the Existing Features, the polygon's boundary (line) will be used. Lines that cross at a point will be appended; lines that share a line segment will not.</para>
            /// <para>被轮廓交叉 - 如果添加要素源要素类中的要素被其中一个现有要素的轮廓交叉，则这些要素将被追加到逻辑示意图中。添加的要素和现有要素必须为直线或面。如果面用于现有要素，则将使用面的边界（线）。将附加在某个点交叉的线;共享线段的线不会。</para>
            /// </summary>
            [Description("Crossed by the outline of")]
            [GPEnumValue("CROSSED_BY_THE_OUTLINE_OF")]
            _CROSSED_BY_THE_OUTLINE_OF,

        }

        /// <summary>
        /// <para>Existing Features</para>
        /// <para>The source feature class on which the spatial query will execute.</para>
        /// <para>将对其执行空间查询的源要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Existing Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _existing_features { get; set; }


        /// <summary>
        /// <para>Search Distance</para>
        /// <para>The distance between features in the Existing Features parameter and features in the Add Features parameter. This parameter is only valid if the Relationship parameter is set to Intersect, Within a distance, Contains, or Within</para>
        /// <para>现有要素参数中的要素与添加要素参数中的要素之间的距离。仅当“关系”参数设置为“相交”、“距离内”、“包含”或“内”时，此参数才有效</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _search_distance { get; set; } = null;


        /// <summary>
        /// <para>Added Features Query Definition</para>
        /// <para>The SQL query that will be used to filter the features to be added to the diagram. Without an SQL query, the features based on the specified source class that are spatially related to the specified existing features will be appended to the diagram.</para>
        /// <para>将用于筛选要添加到逻辑示意图的要素的 SQL 查询。如果没有 SQL 查询，则基于指定源类且在空间上与指定现有要素相关的要素将追加到逻辑示意图中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Added Features Query Definition")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _added_where_clause { get; set; } = null;


        /// <summary>
        /// <para>Existing Features Query Definition</para>
        /// <para>The SQL query that will be used to filter the features existing in the diagram. Without an SQL query, the features based on the specified source class that exist in the diagram will be considered.</para>
        /// <para>将用于筛选逻辑示意图中现有要素的 SQL 查询。如果没有 SQL 查询，将考虑基于关系图中存在的指定源类的特征。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Existing Features Query Definition")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _existing_where_clause { get; set; } = null;


        /// <summary>
        /// <para>Description</para>
        /// <para>The description of the rule.</para>
        /// <para>规则的说明。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Description")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _description { get; set; } = null;


        /// <summary>
        /// <para>Output Network</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Network")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_utility_network { get; set; }


        /// <summary>
        /// <para>Output Diagram Template</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Diagram Template")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_template_name { get; set; }


        public AddSpatialQueryRule SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}